﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GUITest
{
    public partial class CreateContestWithTabs : Form
    {
        public CreateContestWithTabs()
        {
            InitializeComponent();
        }

        private void NextButton_Click(object sender, EventArgs e)
        {
            if(!(CreateContesttabControl.SelectedIndex + 1 > CreateContesttabControl.TabCount - 1))
                CreateContesttabControl.SelectTab(CreateContesttabControl.SelectedIndex +1);
        }

        private void PreviousButton_Click(object sender, EventArgs e)
        {
            if (CreateContesttabControl.SelectedIndex -1 >= 0)
                CreateContesttabControl.SelectTab(CreateContesttabControl.SelectedIndex - 1);
        }

        private void ContestantcomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            NewContestantgroupBox.Visible = true;
            CreateContestTabControlgroupBox.Visible = false;
            ImportgroupBox.Visible = false;
        }

        private void Judge1comboBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {

        }

        private void Judge1comboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            NewContestantgroupBox.Visible = true;
            CreateContestTabControlgroupBox.Visible = false;
            ImportgroupBox.Visible = false;
        }

        private void NewContestantSaveButton_Click(object sender, EventArgs e)
        {
            NewContestantgroupBox.Visible = false;
            CreateContestTabControlgroupBox.Visible = true;
            ImportgroupBox.Visible = false;
        }

        private void NewContestantDiscardButton_Click(object sender, EventArgs e)
        {
            NewContestantgroupBox.Visible = false;
            CreateContestTabControlgroupBox.Visible = true;
            ImportgroupBox.Visible = false;
        }

        private void ImportOkButton_Click(object sender, EventArgs e)
        {
            NewContestantgroupBox.Visible = false;
            CreateContestTabControlgroupBox.Visible = true;
            ImportgroupBox.Visible = false;
        }

        private void ImportCancelButton_Click(object sender, EventArgs e)
        {
            NewContestantgroupBox.Visible = false;
            CreateContestTabControlgroupBox.Visible = true;
            ImportgroupBox.Visible = false;
        }

        private void loadDataFromOldContestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewContestantgroupBox.Visible = false;
            CreateContestTabControlgroupBox.Visible = false;
            ImportgroupBox.Visible = true;
        }

        private void SaveAndExitButton_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }

        private void SaveAndStartButton_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Yes;
            RunningContestWithTabs rc = new RunningContestWithTabs();
            switch (rc.ShowDialog())
            {
                case DialogResult.Yes:
                    break;
                default:
                    break;
            }
        }
    }
}
